#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<iostream>
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;

int main(int argc ,char *argv[])
{
        char ch;
        Mat frame;
        char file[20];
        VideoCapture capture(0);
        for(int num=10;num>0;)
        {
	    capture >> frame;
            sprintf(file,"output/%d.jpg",num--);
            imwrite(file,frame);
	    usleep(300*1000);
        }
	cout<<"Photo finished."<<endl;
        return 0;
}

